package com.example.managemyself.data.model;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.managemyself.util.DateConverter;

import java.util.Date;

/**
 * AI对话记录实体类
 */
@Entity(tableName = "ai_conversations")
@TypeConverters({DateConverter.class})
public class AIConversation {
    @PrimaryKey(autoGenerate = true)
    private int id;
    
    private int userId;              // 用户ID
    private String title;            // 对话标题
    private String summary;          // 对话摘要
    private Date createdAt;          // 创建时间
    private Date updatedAt;          // 更新时间
    private int messageCount;        // 消息数量
    private String lastMessage;      // 最后一条消息
    private boolean isStarred;       // 是否收藏
    private String category;         // 对话分类（任务、健康、日记、其他）
    
    public AIConversation() {
        this.createdAt = new Date();
        this.updatedAt = new Date();
        this.messageCount = 0;
        this.isStarred = false;
        this.category = "其他";
    }
    
    public AIConversation(int userId, String title) {
        this();
        this.userId = userId;
        this.title = title;
    }
    
    // Getters and Setters
    public int getId() {
        return id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public int getUserId() {
        return userId;
    }
    
    public void setUserId(int userId) {
        this.userId = userId;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getSummary() {
        return summary;
    }
    
    public void setSummary(String summary) {
        this.summary = summary;
    }
    
    public Date getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }
    
    public Date getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
    
    public int getMessageCount() {
        return messageCount;
    }
    
    public void setMessageCount(int messageCount) {
        this.messageCount = messageCount;
    }
    
    public String getLastMessage() {
        return lastMessage;
    }
    
    public void setLastMessage(String lastMessage) {
        this.lastMessage = lastMessage;
    }
    
    public boolean isStarred() {
        return isStarred;
    }
    
    public void setStarred(boolean starred) {
        isStarred = starred;
    }
    
    public String getCategory() {
        return category;
    }
    
    public void setCategory(String category) {
        this.category = category;
    }
} 